Writing current score as a MIDI file. Converting MIDI File into measures.